﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static _3_1.Class1;

namespace _3_1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                double x = double.Parse(textBox1.Text);
                double y = double.Parse(textBox2.Text);
                double r = double.Parse(textBox3.Text);

                Circle circle = new Circle();
                circle.SetValue(x, y, r);

                textBox4.Text = circle.GetArea().ToString();
                textBox5.Text = circle.GetPerimeter().ToString();
                textBox6.Text = circle.GetDistance().ToString();
            }
            catch (Exception ex)
            {
                MessageBox.Show("请输入有效的数字！");
            }
        }
    }
}
